![]() |
McGill University - Faculty of Agricultural and Environmental Sciences Department of Agricultural and Biosystems Engineering APPLIED MATHEMATICS Dr. Jacques-André Landry |
Examples of the Uses of Vectors in 3-D Geometry - Part 1
In this file we will review some applications of the use of vectors in dealing with lines and planes in 3D. The file consists of a set of worked examples. Several Maple worksheets are also provided for reference. However, it is strongly recommanded that you type your own solutions into Maple to become familiar with the language and the environment.
a) Find the interior angles of the triangle ABC whose vertices are at the points A(-1,0,2), B(2,1,-1) and C(1,-2,2).
(Maple worksheet for this example)

Find the vectors:
AB = 3I + 1J - 3K
AC = 2I - 2J + 0K
BC = -1I - 3J + 3K
Get the angle from the dot product:
COS(angle A) = AB.AC / { |AB| |AC| }
angle A = 71.07 deg
COS(angle B) = AB.BC / { |AB| |BC| }
angle B = 142.14 deg.
But this is the angle between AB and BC if both did originate at the same point. The interior angle should be calculated using BA and BC. So the interior is (180 -142.14) deg.:
angle B = 37.86 deg
angle C = 180 - 71.07 - 37.86 = 71.07 deg
With Maple, start off with the three "position vectors" from the origin to the vertices, and subtract these to get the vectors having the magnitudes and directions of the sides of the triangle - note that, strictly speaking, these vectors are not "THE SIDES" of the triangle, because vectors are not "fixed" in space, but the sides are. However, for all intents and purposes, here you can simply treat the vectors as the triangle's sides. First load our linear algebra functions and definitions from the module linalg and then proceed:
Once the vectors are entered, we can find the angle between each pair:
Note that the sum of the three angles is greater than 180 degrees. To decide which is an interior angle and which an exterior, you would have to look at the triangle. In this case it is Angle_B which is exterior; the interior value of Angle_B is therefore 180 - 142.136 = 37.864 degrees.
Does it make sense that angle a = angle c? Well, we can verify that easily:
Another way to attack this problem is by defining all six vectors (AB, BA, AC, CA, BC and CB), then finding the three angles with the vectors pointing in the right direction so that the interior angle is always found:
b) Find the angle between the diagonal of a cube and one of its edges.
(Maple worksheet for this example)

Choose the simplest possible cube having edges:
A = 1I + 0J + 0K
B = 0I + 1J + 0K
C = 0I + 0J + 1K
The diagonal is then: D = 1I + 1J + 1K
COS(angle between an edge and the diagonal) = A.D / { |A|
|D| }
angle between an edge and the diagonal = 54.7 deg
In Maple, we define all vectors:
Then we evaluate the angle between each pair:
The three angles are the same!
c) Find the angle between the diagonal of a cube and the diagonal of one of its faces.
(Maple worksheet for this example)

Again, choose again the simplest cube with diagonal D:
A = 1I + 0J + 0K
B = 0I + 1J + 0K
C = 0I + 0J + 1K
D = 1I + 1J + 1K
The diagonal of one of the faces is then: E = 1I + 1J + 0K
COS(angle between cube diagonal and face diagonal) = D.E / { |D| |E|
}
angle between cube diagonal and face diagonal = 35.3 deg
In Maple, use the same procedure as before:
d) Find the bisector vector of two vectors A & B.
(Maple worksheet for this example)

The bisector of A and B is: C = { |A| B + |B| A } / { |A| + |B| }
For example, if A = 2I + 3J + 1K and B = 1I + 2J + 4K
Then COS(angle between A & B) = A.B / { |A| |B| } so that the angle between A & B = 45.6 deg
From the above formula, C = 1.551 I + 2.551 J + 2.349 K
The COS(angle between A & C) = A.C / { |A| |C| } so that the angle between A & C = 22.8 deg. Of course, this is half of the angle between A and B
With Maple:
Check this by verifying the angles between each vector and the bisector:
The two angles are the same, making the new vector at least a candidate for the bisector role - how would you prove it IS the bisector ?
e) Find the distance d of the point P2(x2,y2,z2) from the line (x-x1)/a = (y-y1)/b = (z-z1)/c
(Maple worksheet for this example)
Note: this question implies the perpendicular and shortest distance from the point to the line.

Choose a convenient point P1 on the line; usually P1(x1,y1,z1) will do fine since its coordinates are already available from the Cartesian equation
The vector P1P2 is then: P1P2 = (x2-x1) I + (y2-y1) J + (z2-z1) K and the vector in the direction of the line is: M = aI + bJ + cK
Then d = |P1P2| * SIN(angle between the two vectors) where:
SIN(angle between the two vectors) = |M x P1P2| / { |M| |P1P2| }
so that: d = |M x P1P2| / |M|
For example, for the point P2(2,3,4) and the line (x-1)/2 = (y-2)/1 = (z-3)/2
The point P1 on the line is: P1(1,2,3) and the vector P1P2 = 1I + 1J + 1K
The vector M = 2I + 1J + 2K
M x P1P2 = -1I + 0J +1K and thus, the distance d = 0.471
In Maple:
Obviously, we should obtain the same answer with other points on the line. Let's put this to the test: In parametric form the equation of the line is:
x = 2t + 1
y = t + 2
z = 2t + 3
Thus, if we let t=1, we get the point P4(3,3,5) on the line so that the vector P4P2 is: [-1,0,-1]. Now, we can again calculate the distance with formula #24 and we should get the same answer:
The answer is the same as before! Try this with some other points on the line, just to convince yourself that this method really works.
f) Find the area of the triangle whose vertices are at A(1,-1,0), B(2,1,-1) and C(-1,1,2).

Two sides of the triangle are: AB = 1I + 2J - 1K and AC = -2I + 2J + 2K
The area of the triangle is 1/2 of the area of the parallelogram having AB and AC as sides and the area of the parallelogram is equal to the magnitude of the cross product of the two sides:
AB x AC = 6I + 0J + 6K
|AB x AC| = 8.485
Therefore, the area of the triangle = 4.243
Find the solution using Maple.
g) Find the unit vector perpendicular to the plane determined by the three points A(1,-1,2), B(2,0,-1) and C(0,2,1).

The two vectors AB = 1I + 1J - 3K and AC = -1I + 3J -1K are both parallel to the plane and therefore perpendicular to its normal. The normal vector can thus be found from the cross product AB x AC = 8I + 4J + 4K
The unit normal vector is: { AB x AC } / |AB x AC| = 0.816 I + 0.408 J + 0.408 K
Find the solution using Maple.
h) Find the plane determined by the three points D(1,-1,2), E(2,0,-1) and F(0,2,1).

The two vectors DE and DF are parallel to the plane and thus the normal vector can be found from their cross product:
DE = 1I + 1J - 3K
DF = -1I + 3J - 1K
DE x DF = 8I + 4J + 4K
Only the direction of the normal is significant for the determination of the plane: N = 2I + 1J + 1K
The general equation of the plane is: 2x + y + z = d
The point D(1,-1,2) lies in the plane so that d = 3
The equation of the plane is therefore: 2x + y + z = 3
Find the solution using Maple.
© 1998. Dr. Jacques-André Landry. Some sections based on previous material by Dr. Robert Kok
Edited July 30, 2002. T. J. Rennie.